/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nanterre.annuaire.model;

import java.util.ArrayList;
import java.util.List;
import javax.lang.model.util.Elements;

/**
 *
 * @author illamhat
 */
public class UE extends ElementAnnuaire {
    
    private int fidTypeDip;
    private int semestre;
    private String libelleUe;
    private List<Ec> listeEc;
    private int numListeUe;
    public UE() {
        listeEc = new ArrayList<Ec>();
    }
 
  
    public int getNumListeUe() {
        return numListeUe;
    }

    public void setNumListeUe(int numListeUe) {
        this.numListeUe = numListeUe;
    }
    

    public int getFidTypeDip() {
        return fidTypeDip;
    }

    public void setFidTypeDip(int fidTypeDip) {
        this.fidTypeDip = fidTypeDip;
    }

    public String getLibelleUe() {
        return libelleUe;
    }

    public void setLibelleUe(String libelleUe) {
        this.libelleUe = libelleUe;
    }

    public int getSemestre() {
        return semestre;
    }

    public void setSemestre(int semestre) {
        if(semestre == 0){
            semestre = 10;
        }
        this.semestre = semestre ;
    }

    public List<Ec> getListeEc() {
        return listeEc;
    }

    public void setListeEc(List<Ec> listeEc) {
        this.listeEc = listeEc;
    }
    
    public String afficherUE(int parentID, float nbCredit){
        String nbCreditString = "";
        if(nbCredit != -1){
            nbCreditString = "("+nbCredit+" ECTS)";
        }
        String resultat = "<li id=\"UE"+this.getId()+"\" class=\"fermer\"><a href=\"#\" class=\"arbre\"  onclick=\"deroulerElement('"+this.getId()+"', '"+this.getType().getLabel()+"', '"+parentID+"'); return false;\"><img class=\"derouler\" src=\"images/derouler.jpg\" alt=\"dérouler les informations\" /> UE :"+this.getLibelleComplet()+" ["+this.getCodeApogee()+"] "+nbCreditString+"</a></li>";              
        return resultat;
    }
    
    public String afficherUERecherche(int parentID, float nbCredit){
        String nbCreditString = "";
        if(nbCredit != -1){
            nbCreditString = "("+nbCredit+" ECTS)";
        }
        String resultat = "<li id=\"UE"+this.getId()+"\" class=\"fermer\"><a href=\"#\" class=\"arbre libelleRecherche\"  onclick=\"deroulerElement('"+this.getId()+"', '"+this.getType().getLabel()+"', '"+parentID+"'); return false;\"><img class=\"derouler\" src=\"images/derouler.jpg\" alt=\"dérouler les informations\" /> UE :"+this.getLibelleComplet()+" ["+this.getCodeApogee()+"] "+nbCreditString+"</a></li>";              
        return resultat;
    }
    
    public String afficherUeNotComplete(int parentID, float nbCredit){
        String nbCreditString = "";
        if(nbCredit != -1){
            nbCreditString = "("+nbCredit+" ECTS)";
        }
        String resultat = "<li id=\"UE"+this.getId()+"\" class=\"ouvert\"><a href=\"#\" class=\"arbre\"  onclick=\"deroulerElement('"+this.getId()+"', '"+this.getType().getLabel()+"', '"+parentID+"'); return false;\"><img class=\"derouler\" src=\"images/enrouler.jpg\" alt=\"dérouler les informations\" /> UE :"+this.getLibelleComplet()+" ["+this.getCodeApogee()+"] "+nbCreditString+"</a>";              
        return resultat;
    }

    
    
}
